home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 1891 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: zetnet.co.uk!demon!mjeff.demon.co.uk
  2. From: mick@mjeff.demon.co.uk (mick)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: More linked list nonsense
  5. Date: Wed, 24 Jan 1996 20:22:08 GMT
  6. Message-ID: <715.6597T1199T1745@mjeff.demon.co.uk>
  7. References: <4e5nih$iib@news.sdd.hp.com>
  8. NNTP-Posting-Host: mjeff.demon.co.uk
  9. X-NNTP-Posting-Host: mjeff.demon.co.uk
  10. X-Newsreader: THOR 2.22 (Amiga;TCP/IP) *UNREGISTERED*
  11.  
  12.  
  13. On 24-Jan-96 21:42:57 Jeff Grimmett wrote
  14. >Howdy,
  15.  
  16. >It just occurred to me last night, as I pored over steaming code, that
  17. >the function Remove() (used to remove nodes from linked lists) might
  18. >POSSIBLY not be freeing the memory allocated to the node it is removing.
  19. >Does anyone have some insight on this?
  20.  
  21. All Remove() does is remove (unlink) the node from the list, it's not
  22. supposed to free the memory. If you allocated the memory for the nodes
  23. then you are supposed to free it, (after Remove()'ing the node from the list
  24. first, of course).
  25.  
  26. >It's difficult to deallocate a node once it's not part of the list, but
  27. >it's pretty STUPID to free it >BEFORE. :-)
  28.  
  29. Why is it difficult to deallocate a node?
  30.  
  31.  
  32. Mick.
  33.  
  34.